function [ Means, Radiuses ] = TrainingFunc( trainingFolder )
%TrainingFunc: Gets an folder with subfolder consisting training sets and
%returns the means their radius

folder = dir(trainingFolder);

isSub = [folder(:).isdir];
subFolderNames = {folder(isSub).name}';
subFolderNames(ismember(subFolderNames,{'.','..'})) = []; %Delete pseudo directories

Means = [];
Radiuses = [];

for i = 1:length(subFolderNames)
    pictures = dir([trainingFolder,'/',subFolderNames{i},'/*.jpeg']);
    
    featureMatrix = [];
    
    for j = 1:length(pictures)
        featureVector = FeatureExtraction([trainingFolder,'/',subFolderNames{i},'/',pictures(j).name]);
        featureMatrix = [featureMatrix; featureVector];
    end
    
    [Mean,Radius] = GenerateMean(featureMatrix);
    
    Means = [Means; Mean];
    Radiuses = [Radiuses; Radius];
end

